import pytest
from api.ihrm_api import IhrmApi
from common.header_util import HeaderUtil
from common.ihrm_assert import Ihrmcommon
from common.read_data import read_ihrmSearch


class TestIhrmSearch:
    # 定义类实例
    header = None

    # 定义请求头
    @classmethod
    def setup_class(cls):
        cls.header = HeaderUtil.loginApi()

    @pytest.mark.parametrize('emp_id, state_code, success, code, message',read_ihrmSearch())
    def test(self, emp_id, state_code, success, code, message):
        # 查找员工
        search_result = IhrmApi.Search(emp_id,self.header)
        # print(search_result.json())
        Ihrmcommon.uid_assert(search_result,state_code,success, code, message)
